[mirrors]
http://www.wireshark.org/download/src/all-versions/wireshark-1.12.11.tar.bz2

[vars]
filesize=29307302
sha512=4752a56386bebab951044309381e736ed1e1bb5a7ea852d2e382be56493bd429d90f60868cd2914c43498dd1e0a2a26c350e3926383f2b75683fa3c16400f053
desc='sniff, decrypt, analyze and visualize network traffic'

[deps]
glib
libpcap
gtk+2
libgcrypt
gnutls
lua

[build]
patch -p1 < "$K"/wireshark-window-icon.patch
patch -p1 < "$K"/wireshark-dirent_macros.patch

for i in ui/export_object_smb.c epan/dissectors/packet-ssl-utils.c ; do
	sed -i 's@g_memmove@memmove@g' "$i"
done
sed -i 's@DISABLE_DEPRECATED@ENABLE_DEPRECATED@g' configure

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"

printf "#!/bin/sh\necho -lpcap\n" > pcap-config
chmod +x pcap-config
export PATH="$PWD:$PATH"

CPPFLAGS=-D_GNU_SOURCE \
CFLAGS="$optcflags -Werror=implicit-function-declaration" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --with-qt=no --with-gtk2=yes --with-gtk3=no

[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make -C tools/lemon V=1 CC_FOR_BUILD=gcc
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
install -m644 -D wireshark.desktop "$dest/share/applications/wireshark.desktop"
install -m644 -D image/wsicon48.png "$dest/share/pixmaps/wireshark.png"
